/********************************************************************

Write Date: 2011/07/29
Author: Deng Nianchen
>>>> Add class FileWriter

*********************************************************************/
#ifndef FILEREADER_H
#define FILEREADER_H
#include "streamwriter.hpp"
#include <fstream>


_OOPUTILS_BEGIN



/**************************************************************************************************
 * <summary> Purpose: Inherited from StreamWriter, used to write data to file.
 *					 Often be combined with other StreamWriters such as
 *					 BufferWriter and TextWriter to gain additional abilities.
 * 					 Thread-Safe: the class is not thread-safe. </summary>
 * 
 * <remarks>  Deng Nianchen, 2011/07/29. </remarks>
 **************************************************************************************************/

class FileWriter : public StreamWriter
{
public:

	FileWriter (const OOPString & filename);

	~FileWriter ();

	virtual void resetPos ();

	virtual void write (OOPPtr< ByteArray > data);

	virtual void skip (size_t count);

	virtual size_t getPos ();

	void open (const OOPString & filename);

	void close ();

	virtual void setPos (size_t pos);

private:

	std::ofstream _fout;

};



_OOPUTILS_END
#endif